package com.mdb.open.trade.rabbit.provider;
/*
 * Copyright (C), 2017-2019 澳发科技(MDB)
 * FileName: MerchantSyncQichachaProducer.java
 * Author:   符楚
 * Date:     2019-10-14 15:37
 * History:
 * <author>          <time>          <version>          <desc>
 * 符楚               2019-10-14          V1.00             新建
 * -----------------------------------------------------------
 * 作者姓名           修改时间           版本号            描述
 */

import com.mdb.bc.logger.LogAnnotation;
import com.mdb.open.trade.config.RabbitConfig;
import com.mdb.open.trade.rabbit.model.SyncQichachaEvent;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 发布同步企查查事件<br>
 * <br>
 *
 * @author 符楚
 * @Date 2019-10-14 15:37
 */
@Component
public class SyncQichachaProducer {


    @Autowired
    private RabbitTemplate rabbitTemplate;


    /**
     * 发布同步企查查事件
     *
     * @param customerCode
     * @param merchantNo
     */
    @LogAnnotation("发布同步企查查事件")
    public void send(String customerCode, String merchantNo) {

        SyncQichachaEvent event = new SyncQichachaEvent();
        event.setCustomerCode(customerCode);
        event.setMerchantNo(merchantNo);

        rabbitTemplate.convertAndSend("customerExchange", RabbitConfig.QUEUE_MERCHANT_SYNC_QICHACHA, event);
    }
}
